;
(function(win){
    var doc = win.document;
    var docEl = doc.documentElement;
    var _t;
    function refreshRemFn(){
        var _width = docEl.getBoundingClientRect().width;
        if( _width>640 ) {
            _width=640;
        }
        var _rem = _width/6.4;
        docEl.style.fontSize = _rem + 'px';
    }

    win.addEventListener('resize',function(){
        this.clearTimeout(_t);
        _t = setTimeout(refreshRemFn(), 300);
    },false)
    refreshRemFn();
})(window);